const { GameServer } = require('board-game');
const { server } = require('./config');

const UndercoverRole = require('./role');
const UndercoverBoard = require('./board');
const UndercoverGame = require('./game');

GameServer.start({
    doPreVote: ({ role, data }) => role.doPreVote(data),
    doVote: ({ role }) => role.doVote(),
    doConfirm: ({ role }) => role.doConfirm(),
    doDeny: ({ role }) => role.doDeny(),
    doDescribeEnd: ({ role, data }) => role.doDescribeEnd(data),
}, {
    Board: UndercoverBoard,
    Role: UndercoverRole,
    Game: UndercoverGame,
}, server, {
    index: './web/index.js',
    compress: process.env.NODE_ENV !== 'development',
    watch: process.env.NODE_ENV === 'development',
    stats: 'verbose',
    devtools: process.env.NODE_ENV === 'development'
});
